export function iframeLoad(route) {
  let flag = true // URL是否包含问号
  let iframeUrl = ''
  if (!route.query.src) return ''
  if (route.query.src.indexOf('?') === -1) {
    flag = false
  }
  var list = []
  for (var key in route.query) {
    if (key !== 'src' && key !== 'name') {
      if (!route.query.src.includes('menuCode')) {
        list.push(`${key}=${route.query[key]}`)
      }
    }
  }
  list = list.join('&').toString()
  if (route.query.src && !route.query.src.includes('menuCode')) {
    if (flag) {
      iframeUrl = `${route.query.src}${
        list.length > 0 ? `&${list}` : ``
      }`
    } else {
      iframeUrl = `${route.query.src}${
        list.length > 0 ? `?${list}` : ``
      }`
    }
  }
  /* if (flag && !route.query.src.includes('menuCode')) {
    iframeUrl = `${route.query.src}${
      list.length > 0 ? `&${list}` : ``
    }`
  }
  if (!flag && !route.query.src.includes('menuCode')) {
    iframeUrl = `${route.query.src}${
      list.length > 0 ? `?${list}` : ``
    }`
  }*/
  return iframeUrl
}
